/**
 * 明细补卡日期不可选择上月
 * 
 * ydh
 */
var ycrq = 'field11847'; // 补卡日期
jQuery(function() {
		var date = new Date();
		var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
		var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
		var fd = formatDate(firstDay);
		var ld = formatDate(lastDay);
    var detailMark = WfForm.getDetailAllRowIndexStr("detail_1");
    var strs= new Array();
    strs = detailMark.split(","); 
    for ( var i = 0; i < strs.length; i++) {
       var index =i;
       WfForm.controlDateRange(ycrq+'_'+index, fd, '2099-12-31');  
		   WfForm.controlDateRange(ycrq+'_'+index, fd, '2099-12-31');
    }
		
});

//日期浏览按钮不能选择上个月日期
function formatDate(date) {
  var d = new Date(date),
    month = '' + (d.getMonth() + 1),
    day = '' + d.getDate(),
    year = d.getFullYear();

  if (month.length < 2) month = '0' + month;
  if (day.length < 2) day = '0' + day;

  return [year, month, day].join('-');
}

// <script>
// ecodeSDK.load({
// id: '4ee663d347d7479bbdda42b6894c9697',
// noCss: true,
// cb: function () {
// }
// });
// </script>